home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / OCETemplates.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  90KB  |  1,835 lines

  1. /*
  2.      File:        OCETemplates.h
  3.  
  4.      Contains:    Apple Open Collaboration Environment Templates Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __OCETEMPLATES__
  19. #define __OCETEMPLATES__
  20.  
  21. #ifndef REZ
  22. #ifndef __TYPES__
  23. #include <Types.h>
  24. #endif
  25. #ifndef __EVENTS__
  26. #include <Events.h>
  27. #endif
  28. #endif /* REZ */
  29. #ifndef __OCE__
  30. #include <OCE.h>
  31. #endif
  32. #ifndef REZ
  33. #ifndef __OCESTANDARDMAIL__
  34. #include <OCEStandardMail.h>
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT_SUPPORTED
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_ALIGN_SUPPORTED
  46. #pragma options align=mac68k
  47. #endif
  48.  
  49. #endif /* REZ */
  50. #if FOR_SYSTEM7_ONLY
  51.  
  52. /************************************************************************************************
  53.  ********************************* Template Resource Constants: *********************************
  54.  ************************************************************************************************/
  55.  
  56.  
  57. /* Current versions of all the different template types: */
  58.  
  59. #define kDETAspectVersion        -976
  60. #define kDETInfoPageVersion        -976
  61. #define kDETKillerVersion        -976
  62. #define kDETForwarderVersion    -976
  63. #define kDETFileTypeVersion        -976
  64.  
  65.  
  66. /*    'Normal' separation for template IDs within the file (this is just a suggestion; you can use whatever
  67.     separation you like, so long as two separate templates don't have overlapping resources): */
  68. #define kDETIDSep 250
  69.  
  70. /* A few predefined base IDs (again, just suggestions): */
  71. #define kDETFirstID        (1000)
  72. #define kDETSecondID    (1000+kDETIDSep)
  73. #define kDETThirdID        (1000+2*kDETIDSep)
  74. #define kDETFourthID    (1000+3*kDETIDSep)
  75. #define kDETFifthID        (1000+4*kDETIDSep)
  76.  
  77.  
  78.  
  79. /*    Templates consist of a set of associated resources, at constant offsets from a 'base ID' set by the
  80.     signature resource of the template. In the case of aspect templates, most of the resources in the
  81.     template are accessible from the template as property default values. The property number is the same
  82.     as the offset from the base ID of the resource. In describing the resources which make up templates,
  83.     we give the type, the offset, and a description. For aspect templates, the offset is also the property #. 
  84.     
  85.     All templates include the following resource fork resources:
  86.  
  87.      Type    Offset                        Description
  88.      ----    ------                        -----------
  89.     'rstr'    kDETTemplateName            Contains the name of the template
  90.  
  91. */
  92.  
  93. #define kDETTemplateName 0
  94.  
  95. /*    Aspects, info-pages, and forwarders include the following as well:
  96.  
  97.      Type    Offset                        Description
  98.      ----    ------                        -----------
  99.     'rstr'    kDETRecordType                Contains the type of record this applies to
  100.     'rstr'    kDETAttributeType            Contains the type of attribute this applies to
  101.     'detn'    kDETAttributeValueTag        Contains the tag of the attribute values this applies to
  102.  
  103. */
  104.  
  105. #define kDETRecordType                1
  106. #define kDETAttributeType            2
  107. #define kDETAttributeValueTag        3
  108.  
  109.  
  110.  
  111. /* ************************************ Aspects */
  112.  
  113. /*    In the case of aspects, property numbers and resource id offsets are the same. Therefore, some of the following
  114.     defines are used for resource offsets, some are used for dynamically generated properties, and some are used for
  115.     both (i.e., properties which may be dynamically generated, but if they aren't, then they're taken from the
  116.     resource). Resource types are given in all cases below; even if there is no actual resource (for example in
  117.     the case of kDETAspectName), it indicates the type for the dynamically generated property. A resource type of
  118.     'rstr' corresponds to a property type of kDETPrTypeString; type 'detn' corresponds to kDETPrTypeNumber; and
  119.     'detb' corresponds to kDETPrTypeBinary.
  120.  
  121.  
  122.  
  123.      Type    Offset                        Description
  124.      ----    ------                        -----------
  125.     'deta'    0                            Identifies the type of resource
  126.     'detc'    kDETCode                    Is the code resource, if any is used
  127.     'ICN#'    kDETAspectMainBitmap
  128.     'icl8'    kDETAspectMainBitmap
  129.     'icl4'    kDETAspectMainBitmap
  130.     'ics#'    kDETAspectMainBitmap
  131.     'ics8'    kDETAspectMainBitmap
  132.     'ics4'    kDETAspectMainBitmap
  133.     'sicn'    kDETAspectMainBitmap        Is the icon suite to display for this item type (main aspect only)
  134.     'rstr'    kDETAspectName                Contains the name of the item (attribute main aspect only)
  135.     'rst#'    kDETAspectCategory            Contains the internal categories for the record type (main aspect only)
  136.     'rst#'    kDETAspectExternalCategory    Contains the external (user-visible) names which correspond to the categories in
  137.                                         kDETAspectCategory; if this resource is not present, external names are taken from
  138.                                         another template; if no other template provides an external name for a given internal
  139.                                         category, the internal name is used as the external name (main aspect only)
  140.     'rstr'    kDETAspectKind                Is the item kind to display (main aspect only)
  141.     'detn'    kDETAspectGender            Is the gender of this kind of object for internationalization (main aspect only)
  142.     'rstr'    kDETAspectWhatIs            Is the string for balloon help when item is in sublist (main aspect only)
  143.     'rstr'    kDETAspectAliasKind            Is the item kind to display for aliases to this type of item (main aspect only)
  144.     'detn'    kDETAspectAliasGender        Is the gender of an alias to this kind of object for internationalization (main aspect only)
  145.     'rstr'    kDETAspectAliasWhatIs        Is the string for balloon help when an alias to the item is in sublist (main aspect only)
  146.     'rst#'    kDETAspectBalloons            Is a list of strings for balloon help; for each item in an info-page, it's
  147.                                         property # times 2 is used as an index into this array; if the item is not editable,
  148.                                         then the property # times 2 plus 1 is used
  149.  
  150.  
  151.     'rstr'    kDETAspectNewMenuName        Is the string to be used for the user to select new item creation; for records, the
  152.                                         string is used as a menu entry in the Catalogs menu; for attributes, the string
  153.                                         is used in a selection dialog invoked by an 'Add...' button
  154.     'rstr'    kDETAspectNewEntryName        Is the name to be used for new records (with a digit appended if not unique)
  155.     'detb'    kDETAspectNewValue            Is the value to use when creating a new attribute value; the first four bytes
  156.                                         is the tag; the rest is the attribute value contents
  157.     'detn'    kDETAspectSublistOpenOnNew    If true (non-zero), automatically open newly created entries (property can be set
  158.                                         from a code resource, or via a default value in a resource)
  159.     'dett'    kDETAspectLookup            Is the attribute-to-property translation table
  160.     'rstr'    kDETAspectDragInString        Is a string describing the action of dragging into this aspect (if any)
  161.     'rstr'    kDETAspectDragInVerb        Is a single, short word that's the verb of the action (like 'add' or 'drop'; if
  162.                                         there's any doubt, use 'OK')
  163.     'rstr'    kDETAspectDragInSummary        Is a short phrase that describes the action, suitable to be included in a selection list
  164.     'rst#'    kDETAspectRecordDragIn        Is a list of type pairs; in each pair, the first is the type of a record which
  165.                                         can be dragged into this aspect, and the second is the attribute type to store
  166.                                         the reference in
  167.     'rst#'    kDETAspectRecordCatDragIn    Is a list of category/attribute type pairs; in each pair, the first is the
  168.                                         category of records which can be dragged in, and the second is the type of
  169.                                         attribute to place the alias in
  170.     'rst#'    kDETAspectAttrDragIn        Is a list of type triples; in each triple, the first is the record type which can be
  171.                                         dragged from (or '' for any), the second is the attribute type which can be dragged
  172.                                         in, and the third is the attribute type to store the new attribute in
  173.  
  174.  
  175.     'rst#'    kDETAspectDragOut            Is a list of attribute types which can be dragged out of this aspect (an 'rst#'
  176.                                         resource with no entries means nothing can be dragged out; no 'rst#' resource means
  177.                                         everything can be dragged out)
  178.     'detm'    kDETAspectViewMenu            Is a table to fill in the view menu from
  179.     'detp'    kDETAspectReverseSort        Is a table listing which properties to sort in reverse order
  180.     'detw'    kDETAspectInfoPageCustomWindow    Is a specification of a custom window size/placement & whether to use the
  181.                                             page-selector (main aspect only)
  182.     'detv'    kDETAspectInfoPageCustomWindow    Is a view list which is common to all info-pages (main aspect only)
  183. */
  184.  
  185.  
  186. #define kDETAspectCode                     4
  187. #define kDETAspectMainBitmap             5
  188. #define kDETAspectName                     6
  189. #define kDETAspectCategory                 7
  190. #define kDETAspectExternalCategory         8
  191. #define kDETAspectKind                     9
  192. #define kDETAspectGender                10
  193. #define kDETAspectWhatIs                11
  194. #define kDETAspectAliasKind                12
  195. #define kDETAspectAliasGender            13
  196. #define kDETAspectAliasWhatIs            14
  197. #define kDETAspectBalloons                15
  198. #define kDETAspectNewMenuName            16
  199. #define kDETAspectNewEntryName            17
  200. #define kDETAspectNewValue                18
  201. #define kDETAspectSublistOpenOnNew        19
  202. #define kDETAspectLookup                20
  203. #define kDETAspectDragInString            21
  204. #define kDETAspectDragInVerb            22
  205. #define kDETAspectDragInSummary            23
  206. #define kDETAspectRecordDragIn            24
  207. #define kDETAspectRecordCatDragIn        25
  208. #define kDETAspectAttrDragIn            26
  209. #define kDETAspectAttrDragOut            27
  210. #define kDETAspectViewMenu                28
  211. #define kDETAspectReverseSort            29
  212. #define kDETAspectInfoPageCustomWindow    30
  213.  
  214.  
  215.  
  216. /* Properties: */
  217.  
  218. #define kDETNoProperty                -1
  219.  
  220. /* Each aspect has 250 attribute properties in this range: */
  221. #define kDETFirstLocalProperty        0
  222. #define kDETLastLocalProperty         (kDETFirstLocalProperty+249)
  223.  
  224. /* Developers should use property numbers starting at this point: */
  225. #define kDETFirstDevProperty        40
  226.  
  227. /* The following range provides constant numeric properties for use in patterns and comparisons (constant n is
  228.    given by kDETFirstConstantProperty+n): */
  229. #define kDETFirstConstantProperty    250
  230. #define kDETLastConstantProperty    (kDETFirstConstantProperty+249)
  231.  
  232. /* To convert a number into a constant property, add this: */
  233. #define kDETConstantProperty        kDETFirstConstantProperty
  234.  
  235. #define kDETZeroProperty            (kDETConstantProperty+0)
  236. #define kDETOneProperty                (kDETConstantProperty+1)
  237. #define kDETFalseProperty            (kDETConstantProperty+0)
  238. #define kDETTrueProperty            (kDETConstantProperty+1)
  239.  
  240. /* The following apply to records, attributes, or aliases; they are the name and kind, as they appear in icon lists: */
  241. #define kDETPrName                     3050
  242. #define kDETPrKind                     3051
  243.  
  244. /* Access mask properties: */
  245. #define kDETDNodeAccessMask            25825    /* The DNode access mask */
  246. #define kDETRecordAccessMask        25826    /* The record access mask */
  247. #define kDETAttributeAccessMask        25827    /* The attribute access mask */
  248. #define kDETPrimaryMaskByBit        25828    /* A set of sixteen properties to access all bits of the primary mask */
  249.  
  250.  
  251.  
  252. /* See AOCE documentation for details definitions of each of these bits: */
  253. #define kDETPrimarySeeMask            kDETPrimaryMaskByBit
  254. #define kDETPrimaryAddMask            (kDETPrimaryMaskByBit+1)
  255. #define kDETPrimaryDeleteMask        (kDETPrimaryMaskByBit+2)
  256. #define kDETPrimaryChangeMask        (kDETPrimaryMaskByBit+3)
  257. #define kDETPrimaryRenameMask        (kDETPrimaryMaskByBit+4)
  258. #define kDETPrimaryChangePrivsMask    (kDETPrimaryMaskByBit+5)
  259. #define kDETPrimaryTopMaskBit        (kDETPrimaryMaskByBit+15)
  260.  
  261. /* The following property is zero until we've completed the first catalog lookup; from then on it's 1 */
  262. #define kDETPastFirstLookup            26550
  263.  
  264. /* The following property is the page number; issuing a property command with this property will flip info-pages */
  265. #define kDETInfoPageNumber            27050
  266.  
  267. /* The value of the following properties contains the template number of the targeted aspect's template, and the
  268.    currently open info-page (if any). These values can be used with kDETAspectTemplate and kDETInfoPageTemplate
  269.    target selectors. */
  270. #define kDETAspectTemplateNumber    26551
  271. #define kDETInfoPageTemplateNumber    26552
  272.  
  273. /* Properties for property commands to deal with sublist items: */
  274. #define kDETOpenSelectedItems        26553    /* Open selected sublist items */
  275. #define kDETAddNewItem                26554    /* Add new sublist item */
  276. #define kDETRemoveSelectedItems        26555    /* Remove selected sublist items */
  277.  
  278. /* Property types are used to specify types of properties and conversions between types (zero and negative numbers
  279.    are reserved for Apple; developer code resources can use positive numbers): */
  280. #define kDETPrTypeNumber            -1    /* A number */
  281. #define kDETPrTypeString            -2    /* A string */
  282. #define kDETPrTypeBinary            -3    /* A binary block */
  283.  
  284. /* Rez-compatible tag definitions (These are the same as in OCE.h, but they're enums there and can't be rezed***) */
  285. #ifdef REZ
  286. #define typeRString            'rstr'
  287. #define typePackedDSSpec    'dspc'
  288. #define typeBinary            'bnry'
  289. #endif
  290.  
  291.  
  292.  
  293. /* ************************************ Info-pages */
  294.  
  295. /* Info-pages include the following as well:
  296.  
  297.      Type    Offset                        Description
  298.      ----    ------                        -----------
  299.     'deti'    0                            Identifies the type of resource; see below for details on the contents
  300.     'rstr'    kDETInfoPageName            Is the name of the view to use in the page selection pop-up
  301.     'rstr'    kDETInfoPageMainViewAspect    Is the name of the aspect to use with the main page view
  302.     'rstr'    kDETInfoPageMenuName        Is the name of the catalogs menu ('Catalogs' if not present)
  303.     'detm'    kDETInfoPageMenuEntries        Are menu entries to go in the Catalogs menu
  304.  
  305. */
  306.  
  307. #define kDETInfoPageName            4
  308. #define kDETInfoPageMainViewAspect    5
  309. #define kDETInfoPageMenuName        6
  310. #define kDETInfoPageMenuEntries        7
  311.  
  312.  
  313.  
  314.  
  315. /* ************************************ Views 
  316.  
  317.    Flags: */
  318.  
  319. #define kDETNoFlags                        0
  320. #define kDETEnabled                        (1 << 0)    /* Main view (non-sublist) field enabled */
  321.  
  322. /* The following flags make sense for items in a sublist only */
  323. #define kDETHilightIfSelected            (1 << 0)    /* Hilight view when entry is selected */
  324.  
  325. /* The following flags make sense for text views only */
  326. #define kDETNumericOnly                    (1 << 3)    /* Only allow the user to enter digits */
  327. #define kDETMultiLine                    (1 << 4)    /* Allow multiple lines in view */
  328. #define kDETDynamicSize                    (1 << 9)    /* Don't draw box around text until user clicks in it, then auto-size it */
  329. #define kDETAllowNoColons                (1 << 10)    /* Don't allow the user to enter colons (convert ':'s to '-'s) */
  330.  
  331. /* The following flags are used for pop-up menus only */
  332. #define kDETPopupDynamicSize            (1 << 8)    /* Automatically resize pop-up based on contents */
  333.  
  334. /* The following flags are used for EditPicture views only */
  335. #define kDETScaleToView                    (1 << 8)    /* Scale picture to view bounds rather than cropping */
  336.  
  337. /*    Sizes for icons */
  338. #define kDETLargeIcon        0
  339. #define kDETSmallIcon        1
  340. #define kDETMiniIcon        2
  341.  
  342. /* Stolen from TextEdit.h */
  343. #define kDETLeft          0
  344. #define kDETCenter          1
  345. #define kDETRight         -1
  346. #define kDETForceLeft    -2
  347.  
  348.  
  349.  
  350. /* Flags for use within Box view type attributes - these are distinct from the flags above */
  351.  
  352. #define    kDETUnused                    0
  353. #define kDETBoxTakesContentClicks    (1 << 0)
  354. #define kDETBoxIsRounded            (1 << 1)
  355. #define kDETBoxIsGrayed                (1 << 2)
  356. #define kDETBoxIsInvisible            (1 << 3)
  357.  
  358. /* The common font info */
  359.  
  360. #define kDETApplicationFont                 1
  361. #define kDETApplicationFontSize          9
  362. #define kDETAppFontLineHeight            12
  363.  
  364. #define kDETSystemFont                     0
  365. #define kDETSystemFontSize                12
  366. #define kDETSystemFontLineHeight        16
  367.  
  368. #define kDETDefaultFont                     1
  369. #define kDETDefaultFontSize                 9
  370. #define kDETDefaultFontLineHeight        12
  371.  
  372. /*    These were taken from QuickDraw.h (where they're enums and therefore unusable in resource definitions): */
  373. #define kDETNormal                        0
  374. #define kDETBold                        1
  375. #define kDETItalic                        2
  376. #define kDETUnderline                    4
  377. #define kDETOutline                        8
  378. #define kDETShadow                     0x10
  379. #define kDETCondense                 0x20
  380. #define kDETExtend                     0x40
  381.  
  382. #define kDETIconStyle                   -3    /* Normal text style for regular sublist entries, italic text style for aliases */
  383.  
  384. /* View menu: */
  385.  
  386. #define    kDETChangeViewCommand        'view'    /* Change the view; used especially in StaticCommandTextFromView sublist headers */
  387.  
  388.  
  389. /* Info-page window sizes: */
  390.  
  391. /* Default record info-pages: */
  392. #define kDETRecordInfoWindHeight        228
  393. #define kDETRecordInfoWindWidth            400
  394.  
  395. /* Default attribute info-pages: */
  396. #define kDETAttributeInfoWindHeight        250
  397. #define kDETAttributeInfoWindWidth        230
  398.  
  399. /* Page identifying icon (for default info-page layout): */
  400. #define kDETSubpageIconTop        8
  401. #define kDETSubpageIconLeft        8
  402. #define kDETSubpageIconBottom    (kDETSubpageIconTop+32)
  403. #define kDETSubpageIconRight    (kDETSubpageIconLeft+32)
  404. #define kDETSubpageIconRect        {kDETSubpageIconTop, kDETSubpageIconLeft, kDETSubpageIconBottom, kDETSubpageIconRight}
  405.  
  406. /* The following rectangle can be used in a 'deti' with no sublist: */
  407. #define kDETNoSublistRect        {0, 0, 0, 0}
  408.  
  409.  
  410.  
  411.  
  412. /* ************************************ Killers 
  413.  
  414.    Killers include the following as well:
  415.  
  416.      Type    Offset                        Description
  417.      ----    ------                        -----------
  418.     'detk'    0                            Identifies the type of resource; see below for details on the contents
  419.     'rst#'    kDETKillerName                Contains a list of template names to be killed
  420.  
  421. */
  422.  
  423. #define kDETKillerName 1
  424.  
  425.  
  426. /* ************************************ Forwarders 
  427.  
  428.    Forwarders include the following as well:
  429.  
  430.      Type    Offset                        Description
  431.      ----    ------                        -----------
  432.     'detf'    0                            Identifies the type of resource; see below for details on the contents
  433.     'rst#'    kDETForwarderTemplateNames    Contains a list of names of templates to forward to
  434.  
  435. */
  436.  
  437. #define kDETForwarderTemplateNames    4
  438.  
  439.  
  440.  
  441. /*********************************************************************************** 
  442.  ********************************* Categories: ************************************* 
  443.  *********************************************************************************** 
  444.  
  445.    Internal category names: */
  446.  
  447. #define kDETCategoryAllItems        "aoce All Items"        /* Everything in or out of a category */
  448. #define kDETCategoryAddressItems    "aoce Address Items"    /* Anything that can be used to address something */
  449. #define kDETCategoryMisc            "aoce Miscellaneous"    /* Things that don't deserve their own category */
  450.  
  451.  
  452.  
  453. /***********************************************************************************/
  454. /********************************* Code Resources: *********************************/
  455. /***********************************************************************************/
  456. #ifndef REZ
  457. /* Target specification: */
  458.  
  459. enum {
  460.     kDETSelf                    = 0,                            /* The "current" item */
  461.     kDETSelfOtherAspect            = 1,                            /* Another aspect of the current item */
  462.     kDETParent                    = 2,                            /* The parent (i.e., the aspect we're in the sublist of, if any) of the current item */
  463.     kDETSublistItem                = 3,                            /* The itemNumberth item in the sublist */
  464.     kDETSelectedSublistItem        = 4,                            /* The itemNumberth selected item in the sublist */
  465.     kDETDSSpec                    = 5,                            /* The item specified by the packed DSSpec */
  466.     kDETAspectTemplate            = 6,                            /* A specific aspect template (number itemNumber) */
  467.     kDETInfoPageTemplate        = 7,                            /* A specific info-page template (number itemNumber) * Force type to be short */
  468.     kDETHighSelector            = 0xF000
  469. };
  470.  
  471. typedef long DETTargetSelector;
  472. struct DETTargetSpecification {
  473.     DETTargetSelector                 selector;                    /* Target selection method (see above) */
  474.     RStringPtr                         aspectName;                    /* The name of the aspect (kDETSelfOtherAspect, kDETSublistItem,*/
  475.                                                                 /*   kDETSelectedSublistItem, kDETDSSpec); nil for main aspect or none; */
  476.                                                                 /*  always filled in for calls if there is an aspect, even if it's the main aspect */
  477.     long                             itemNumber;                    /* Sublist index (kDETSublistItem & kDETSelectedSublistItem & kDETAspectTemplate);*/
  478.                                                                 /*   1-based indexing */
  479.     PackedDSSpecPtr                 dsSpec;                        /* DSSpec (kDETDSSpec only) */
  480. };
  481. typedef struct DETTargetSpecification DETTargetSpecification;
  482.  
  483. /*
  484.  Code resource calls and call-backs both return an OSType:
  485.         kDETDidNotHandle (1)    = used by template to say "I didn't handle it" (for calls only)
  486.         noErr                    = function completed successfully
  487.         any error                = function failed, and here's why
  488. */
  489. #define kDETDidNotHandle 1
  490. /*
  491.  Call-back functions:
  492.  
  493.         reqFunction                            Action
  494.         -----------                            ------
  495.         kDETcmdBeep                            Call SysBeep; useful for testing that a code resource's calls/call-backs are working at all
  496.  
  497.         kDETcmdBusy                            Put up watch cursor and switch processes; user events elicit a beep
  498.  
  499.         kDETcmdChangeCallFors                Change call-fors mask
  500.  
  501.         kDETcmdGetCommandSelectionCount        Get the command selection count (for calls which have a command selection list)
  502.         kDETcmdGetCommandItemN                Get command selection item n (for calls which have a command selection list)
  503.  
  504.         kDETcmdOpenDSSpec                    PackedDSSpec open (can also be done via AppleEvents -- this is a short-cut)
  505.  
  506.         kDETcmdAboutToTalk                    About to talk to user: bring us to front, disable watch cursor, etc.
  507.  
  508.         kDETcmdUnloadTemplates                Flush templates
  509.  
  510.         kDETcmdTemplateCounts                Return number of aspect and info-page templates in system
  511.  
  512.         kDETcmdGetDSSpec                    Get the PackedDSSpec for this object
  513.  
  514.         kDETcmdSublistCount                    Return the count of the sublist items
  515.         kDETcmdSelectedSublistCount            Return the count of the selected sublist items
  516.  
  517.         kDETcmdRequestSync                    Request a sync-up of the aspect with the catalog
  518.  
  519.         kDETcmdBreakAttribute                Break an attribute -- apply all applicable patterns to an attribute to generate properties
  520.  
  521.         kDETcmdGetTemplateFSSpec            Get the FSSpec of the file containing the template
  522.  
  523.         kDETcmdGetOpenEdit                    Return the property of the view being edited (or kDETNoProperty if none)
  524.         kDETcmdCloseEdit                    Close the current edit
  525.  
  526.         kDETcmdGetPropertyType                Get a property type
  527.  
  528.         kDETcmdGetPropertyNumber            Get a property, number format
  529.         kDETcmdGetPropertyRString            Get a property, RString format
  530.         kDETcmdGetPropertyBinarySize        Get a property, binary, return size
  531.         kDETcmdGetPropertyBinary            Get a property, binary format
  532.  
  533.         kDETcmdGetPropertyChanged            Get a property changed flag
  534.         kDETcmdGetPropertyEditable            Get a property editable flag
  535.  
  536.         kDETcmdSetPropertyType                Set a property type
  537.  
  538.         kDETcmdSetPropertyNumber            Set a property, number format
  539.         kDETcmdSetPropertyRString            Set a property, RString format
  540.         kDETcmdSetPropertyBinary            Set a property, binary data & size
  541.  
  542.         kDETcmdSetPropertyChanged            Set a property changed flag
  543.         kDETcmdSetPropertyEditable            Set a property editable flag
  544.  
  545.         kDETcmdDirtyProperty                Dirty a property (notify other code resources of change)
  546.  
  547.         kDETcmdDoPropertyCommand            Issue a property command
  548.  
  549.         kDETcmdAddMenu                        Add to the end of a dynamic menu
  550.         kDETcmdRemoveMenu                    Remove a dynamic menu item
  551.         kDETcmdMenuItemRString                Get a dynamic menu item RString
  552.  
  553.         kDETcmdSaveProperty                    Force a save of a property -- apply all applicable patterns to write out the property
  554.  
  555.         kDETcmdGetCustomViewUserReference    Get custom view user reference (as given in .r file)
  556.         kDETcmdGetCustomViewBounds            Get custom view current bounds
  557.  
  558.         kDETcmdGetResource                    Get a resource from a template
  559. */
  560.  
  561. enum {
  562.     kDETcmdSimpleCallback        = 0,
  563.     kDETcmdBeep                    = 1,
  564.     kDETcmdBusy                    = 2,
  565.     kDETcmdChangeCallFors        = 3,
  566.     kDETcmdGetCommandSelectionCount = 4,
  567.     kDETcmdGetCommandItemN        = 5,
  568.     kDETcmdOpenDSSpec            = 6,
  569.     kDETcmdAboutToTalk            = 7,
  570.     kDETcmdUnloadTemplates        = 8,
  571.     kDETcmdTemplateCounts        = 9,
  572.     kDETcmdTargetedCallback        = 1000,
  573.     kDETcmdGetDSSpec            = 1001,
  574.     kDETcmdSublistCount            = 1002,
  575.     kDETcmdSelectedSublistCount    = 1003,
  576.     kDETcmdRequestSync            = 1004,
  577.     kDETcmdBreakAttribute        = 1005,
  578.     kDETcmdGetTemplateFSSpec    = 1006,
  579.     kDETcmdGetOpenEdit            = 1007,
  580.     kDETcmdCloseEdit            = 1008,
  581.     kDETcmdPropertyCallback        = 2000,
  582.     kDETcmdGetPropertyType        = 2001,
  583.     kDETcmdGetPropertyNumber    = 2002,
  584.     kDETcmdGetPropertyRString    = 2003,
  585.     kDETcmdGetPropertyBinarySize = 2004,
  586.     kDETcmdGetPropertyBinary    = 2005,
  587.     kDETcmdGetPropertyChanged    = 2006,
  588.     kDETcmdGetPropertyEditable    = 2007,
  589.     kDETcmdSetPropertyType        = 2008,
  590.     kDETcmdSetPropertyNumber    = 2009,
  591.     kDETcmdSetPropertyRString    = 2010,
  592.     kDETcmdSetPropertyBinary    = 2011,
  593.     kDETcmdSetPropertyChanged    = 2012,
  594.     kDETcmdSetPropertyEditable    = 2013,
  595.     kDETcmdDirtyProperty        = 2014,
  596.     kDETcmdDoPropertyCommand    = 2015,
  597.     kDETcmdAddMenu                = 2016,
  598.     kDETcmdRemoveMenu            = 2017,
  599.     kDETcmdMenuItemRString        = 2018,
  600.     kDETcmdSaveProperty            = 2019,
  601.     kDETcmdGetCustomViewUserReference = 2020,
  602.     kDETcmdGetCustomViewBounds    = 2021,
  603.     kDETcmdGetResource            = 2022,                            /* Force type to be long */
  604.     kDETcmdHighCallback            = 0xF0000000
  605. };
  606.  
  607. typedef unsigned long DETCallBackFunctions;
  608. /*
  609.  Call functions:
  610.  
  611.         reqFunction                        Action
  612.         -----------                        ------
  613.         kDETcmdInit                        Called once when template is first loaded (good time to allocate private data); returns call-for list
  614.         kDETcmdExit                        Called once when template is freed (good time to free private data)
  615.  
  616.         kDETcmdAttributeCreation        New sublist attribute creation about to occur; this gives the template a chance to modify
  617.                                         the value that's about to be created; sent to the template that will be used for
  618.                                         the main aspect of the new entry
  619.  
  620.         kDETcmdDynamicForwarders        Return a list of dynamically created forwarders
  621.  
  622.         kDETcmdInstanceInit                Called once when instance of template is started (good time to allocate private instance data)
  623.         kDETcmdInstanceExit                Called once when instance is ended (good time to free private instance data)
  624.  
  625.         kDETcmdIdle                        Called periodically during idle times
  626.  
  627.         kDETcmdViewListChanged            Called when the info-page view-list (list of enabled views) has changed
  628.  
  629.         kDETcmdValidateSave                Validate save: about to save info-page, return noErr (or kDETDidNotHandle) if it's OK to do so
  630.  
  631.         kDETcmdDropQuery                Drop query: return the appropriate operation for this drag; ask destination
  632.         kDETcmdDropMeQuery                Drop query: return the appropriate operation for this drag; ask dropee
  633.  
  634.         kDETcmdAttributeNew                Attribute value new (return kDETDidNotHandle to let normal new processing occur)
  635.         kDETcmdAttributeChange            Attribute value change (return kDETDidNotHandle to let normal change processing occur)
  636.         kDETcmdAttributeDelete            Attribute value delete (return kDETDidNotHandle to let normal deletion occur); sent to the
  637.                                         main aspect of the attribute that's about to be deleted
  638.         kDETcmdItemNew                    Target item (record or attribute) has just been created
  639.  
  640.         kDETcmdOpenSelf                    Self open (return noErr to prevent opening; return kDETDidNotHandle to allow it)
  641.  
  642.         kDETcmdDynamicResource            Return a dynamically created resource
  643.  
  644.         kDETcmdShouldSync                Check if the code resource wants to force a sync (update data from catalog)
  645.         kDETcmdDoSync                    Give code resource a chance to sync (read in and break all attributes)
  646.  
  647.         kDETcmdPropertyCommand            Command received in the property number range (usually means a button's been pushed)
  648.  
  649.         kDETcmdMaximumTextLength        Return maximum size for text form of property
  650.  
  651.         kDETcmdPropertyDirtied            Property dirtied, need to redraw
  652.  
  653.         kDETcmdPatternIn                Custom pattern element encountered on reading in an attribute
  654.         kDETcmdPatternOut                Custom pattern element encountered on writing out an attribute
  655.  
  656.         kDETcmdConvertToNumber            Convert from template-defined property type to number
  657.         kDETcmdConvertToRString            Convert from template-defined property type to RString
  658.         kDETcmdConvertFromNumber        Convert from number to template-defined property type
  659.         kDETcmdConvertFromRString        Convert from RString to template-defined property type
  660.  
  661.         kDETcmdCustomViewDraw            Custom view draw
  662.         kDETcmdCustomViewMouseDown        Custom view mouse down
  663.  
  664.         kDETcmdKeyPress                    Key press (used primarily to filter entry into EditText views)
  665.         kDETcmdPaste                    Paste (used primarily to filter entry into EditText views)
  666.  
  667.         kDETcmdCustomMenuSelected        Custom Catalogs menu selected
  668.         kDETcmdCustomMenuEnabled        Return whether custom Catalogs menu entry should be enabled
  669. */
  670.  
  671. enum {
  672.     kDETcmdSimpleCall            = 0,
  673.     kDETcmdInit                    = 1,
  674.     kDETcmdExit                    = 2,
  675.     kDETcmdAttributeCreation    = 3,
  676.     kDETcmdDynamicForwarders    = 4,
  677.     kDETcmdTargetedCall            = 1000,
  678.     kDETcmdInstanceInit            = 1001,
  679.     kDETcmdInstanceExit            = 1002,
  680.     kDETcmdIdle                    = 1003,
  681.     kDETcmdViewListChanged        = 1004,
  682.     kDETcmdValidateSave            = 1005,
  683.     kDETcmdDropQuery            = 1006,
  684.     kDETcmdDropMeQuery            = 1007,
  685.     kDETcmdAttributeNew            = 1008,
  686.     kDETcmdAttributeChange        = 1009,
  687.     kDETcmdAttributeDelete        = 1010,
  688.     kDETcmdItemNew                = 1011,
  689.     kDETcmdOpenSelf                = 1012,
  690.     kDETcmdDynamicResource        = 1013,
  691.     kDETcmdShouldSync            = 1014,
  692.     kDETcmdDoSync                = 1015,
  693.     kDETcmdPropertyCall            = 2000,
  694.     kDETcmdPropertyCommand        = 2001,
  695.     kDETcmdMaximumTextLength    = 2002,
  696.     kDETcmdPropertyDirtied        = 2003,
  697.     kDETcmdPatternIn            = 2004,
  698.     kDETcmdPatternOut            = 2005,
  699.     kDETcmdConvertToNumber        = 2006,
  700.     kDETcmdConvertToRString        = 2007,
  701.     kDETcmdConvertFromNumber    = 2008,
  702.     kDETcmdConvertFromRString    = 2009,
  703.     kDETcmdCustomViewDraw        = 2010,
  704.     kDETcmdCustomViewMouseDown    = 2011,
  705.     kDETcmdKeyPress                = 2012,
  706.     kDETcmdPaste                = 2013,
  707.     kDETcmdCustomMenuSelected    = 2014,
  708.     kDETcmdCustomMenuEnabled    = 2015,
  709.     kDETcmdHighCall                = 0xF0000000                    /* Force the type to be long */
  710. };
  711.  
  712. typedef unsigned long DETCallFunctions;
  713. /* Valid commandIDs for DETDropQueryBlock and DETDropMeQueryBlock (in addition to property numbers): */
  714.  
  715. enum {
  716.     kDETDoNothing                = 'xxx0',
  717.     kDETMove                    = 'move',
  718.     kDETDrag                    = 'drag',
  719.     kDETAlias                    = 'alis'
  720. };
  721.  
  722. struct DETProtoCallBackBlock {
  723.     DETCallBackFunctions             reqFunction;                /* Requested function */
  724.     DETTargetSpecification             target;                        /* The target for the request */
  725.     short                             property;                    /* The property to apply the request to */
  726. };
  727. typedef struct DETProtoCallBackBlock DETProtoCallBackBlock;
  728.  
  729. struct DETBeepBlock {
  730.     DETCallBackFunctions             reqFunction;                /* Requested function */
  731. };
  732. typedef struct DETBeepBlock DETBeepBlock;
  733.  
  734. struct DETBusyBlock {
  735.     DETCallBackFunctions             reqFunction;                /* Requested function */
  736. };
  737. typedef struct DETBusyBlock DETBusyBlock;
  738.  
  739. struct DETChangeCallForsBlock {
  740.     DETCallBackFunctions             reqFunction;                /* Requested function */
  741.     DETTargetSpecification             target;                        /* The target for the request */
  742.     long                             newCallFors;                /*  -> New call-for mask */
  743. };
  744. typedef struct DETChangeCallForsBlock DETChangeCallForsBlock;
  745.  
  746. struct DETGetCommandSelectionCountBlock {
  747.     DETCallBackFunctions             reqFunction;                /* Requested function */
  748.     long                             count;                        /* <-  The number of items in the command selection list */
  749. };
  750. typedef struct DETGetCommandSelectionCountBlock DETGetCommandSelectionCountBlock;
  751.  
  752.  
  753. enum {
  754.     kDETHFSType                    = 0,                            /* HFS item type */
  755.     kDETDSType                    = 1,                            /* Catalog Service item type */
  756.     kDETMailType                = 2,                            /* Mail (letter) item type */
  757.     kDETMoverType                = 3,                            /* Sounds, fonts, etc., from inside a suitcase or system file */
  758.     kDETLastItemType            = 0xF0000000                    /* Force it to be a long (C & C++ seem to disagree about the definition of 0xF000) */
  759. };
  760.  
  761. typedef unsigned long DETItemType;
  762. /* FSSpec plus possibly interesting additional info */
  763. struct DETFSInfo {
  764.     OSType                             fileType;                    /* File type */
  765.     OSType                             fileCreator;                /* File creator */
  766.     unsigned short                     fdFlags;                    /* Finder flags */
  767.     FSSpec                             fsSpec;                        /* FSSpec */
  768. };
  769. typedef struct DETFSInfo DETFSInfo;
  770.  
  771. struct DSRec {
  772.     PackedDSSpecPtr *                dsSpec;                        /* <-  DSSpec for item (caller must DisposHandle() when done) */
  773.     short                             refNum;                        /* <-  Refnum for returned address */
  774.     AuthIdentity                     identity;                    /* <-  Identity for returned address */
  775. };
  776. typedef struct DSRec DSRec;
  777.  
  778. union ItemRec {
  779.     DETFSInfo **                    fsInfo;                        /* <-  FSSpec & info for item (caller must DisposHandle() when done) */
  780.     DSRec                             ds;
  781.     PackedDSSpecPtr *                dsSpec;                        /* <-  DSSpec for item (caller must DisposHandle() when done) */
  782.     LetterSpec **                    ltrSpec;                    /* <-  Letter spec for item (caller must DisposHandle() when done) */
  783. };
  784. typedef union ItemRec ItemRec;
  785.  
  786. struct DETGetCommandItemNBlock {
  787.     DETCallBackFunctions             reqFunction;                /* Requested function */
  788.     long                             itemNumber;                    /*  -> Item number to retrieve (1-based) */
  789.     DETItemType                     itemType;                    /*  -> Type of item to be returned (if we can interpret it as such) */
  790.     ItemRec                         item;
  791. };
  792. typedef struct DETGetCommandItemNBlock DETGetCommandItemNBlock;
  793.  
  794. struct DETGetDSSpecBlock {
  795.     DETCallBackFunctions             reqFunction;                /* Requested function */
  796.     DETTargetSpecification             target;                        /* The target for the request */
  797.     PackedDSSpecPtr *                dsSpec;                        /* <-  Handle with result (caller must DisposHandle() when done) */
  798.     short                             refNum;                        /* <-  Refnum for address if PD */
  799.     AuthIdentity                     identity;                    /* <-  Identity for address */
  800.     Boolean                         isAlias;                    /* <-  True if this entry is an alias */
  801.     Boolean                         isRecordRef;                /* <-  True if this entry is a record reference (reserved) */
  802. };
  803. typedef struct DETGetDSSpecBlock DETGetDSSpecBlock;
  804.  
  805. struct DETGetTemplateFSSpecBlock {
  806.     DETCallBackFunctions             reqFunction;                /* Requested function */
  807.     DETTargetSpecification             target;                        /* The target for the request */
  808.     FSSpec                             fsSpec;                        /* <-  FSSpec of template file */
  809.     short                             baseID;                        /* <-  Base ID of this template */
  810.     long                             aspectTemplateNumber;        /* <-  The template number for this aspect template */
  811. };
  812. typedef struct DETGetTemplateFSSpecBlock DETGetTemplateFSSpecBlock;
  813.  
  814. struct DETGetOpenEditBlock {
  815.     DETCallBackFunctions             reqFunction;                /* Requested function */
  816.     DETTargetSpecification             target;                        /* The target for the request */
  817.     short                             viewProperty;                /* <-  The property of the view being edited (or kNoProperty if none) */
  818. };
  819. typedef struct DETGetOpenEditBlock DETGetOpenEditBlock;
  820.  
  821. struct DETCloseEditBlock {
  822.     DETCallBackFunctions             reqFunction;                /* Requested function */
  823.     DETTargetSpecification             target;                        /* The target for the request */
  824. };
  825. typedef struct DETCloseEditBlock DETCloseEditBlock;
  826.  
  827. struct DETGetPropertyTypeBlock {
  828.     DETCallBackFunctions             reqFunction;                /* Requested function */
  829.     DETTargetSpecification             target;                        /* The target for the request */
  830.     short                             property;                    /* The property to apply the request to */
  831.     short                             propertyType;                /* <-  The type of the property */
  832. };
  833. typedef struct DETGetPropertyTypeBlock DETGetPropertyTypeBlock;
  834.  
  835. struct DETGetPropertyNumberBlock {
  836.     DETCallBackFunctions             reqFunction;                /* Requested function */
  837.     DETTargetSpecification             target;                        /* The target for the request */
  838.     short                             property;                    /* The property to apply the request to */
  839.     unsigned long                     propertyValue;                /* <-  The value of the property */
  840. };
  841. typedef struct DETGetPropertyNumberBlock DETGetPropertyNumberBlock;
  842.  
  843. struct DETGetPropertyRStringBlock {
  844.     DETCallBackFunctions             reqFunction;                /* Requested function */
  845.     DETTargetSpecification             target;                        /* The target for the request */
  846.     short                             property;                    /* The property to apply the request to */
  847.     RStringHandle                     propertyValue;                /* <-  A handle containing the property (as an RString) (caller must DisposHandle() when done) */
  848. };
  849. typedef struct DETGetPropertyRStringBlock DETGetPropertyRStringBlock;
  850.  
  851. struct DETGetPropertyBinarySizeBlock {
  852.     DETCallBackFunctions             reqFunction;                /* Requested function */
  853.     DETTargetSpecification             target;                        /* The target for the request */
  854.     short                             property;                    /* The property to apply the request to */
  855.     long                             propertyBinarySize;            /* <-  The size of the property as a binary block */
  856. };
  857. typedef struct DETGetPropertyBinarySizeBlock DETGetPropertyBinarySizeBlock;
  858.  
  859. struct DETGetPropertyBinaryBlock {
  860.     DETCallBackFunctions             reqFunction;                /* Requested function */
  861.     DETTargetSpecification             target;                        /* The target for the request */
  862.     short                             property;                    /* The property to apply the request to */
  863.     Handle                             propertyValue;                /* <-  Handle with the value of the property (caller must DisposHandle() when done) */
  864. };
  865. typedef struct DETGetPropertyBinaryBlock DETGetPropertyBinaryBlock;
  866.  
  867. struct DETGetPropertyChangedBlock {
  868.     DETCallBackFunctions             reqFunction;                /* Requested function */
  869.     DETTargetSpecification             target;                        /* The target for the request */
  870.     short                             property;                    /* The property to apply the request to */
  871.     Boolean                         propertyChanged;            /* <-  True if the property is marked as changed */
  872.     Boolean                         filler1;
  873. };
  874. typedef struct DETGetPropertyChangedBlock DETGetPropertyChangedBlock;
  875.  
  876. struct DETGetPropertyEditableBlock {
  877.     DETCallBackFunctions             reqFunction;                /* Requested function */
  878.     DETTargetSpecification             target;                        /* The target for the request */
  879.     short                             property;                    /* The property to apply the request to */
  880.     Boolean                         propertyEditable;            /* <-  True if the property can be edited by the user (if false, view will appear disabled) */
  881.     Boolean                         filler1;
  882. };
  883. typedef struct DETGetPropertyEditableBlock DETGetPropertyEditableBlock;
  884.  
  885. struct DETSetPropertyTypeBlock {
  886.     DETCallBackFunctions             reqFunction;                /* Requested function */
  887.     DETTargetSpecification             target;                        /* The target for the request */
  888.     short                             property;                    /* The property to apply the request to */
  889.     short                             newType;                    /*  -> New type for property (just sets type, does not convert contents) */
  890. };
  891. typedef struct DETSetPropertyTypeBlock DETSetPropertyTypeBlock;
  892.  
  893. struct DETSetPropertyNumberBlock {
  894.     DETCallBackFunctions             reqFunction;                /* Requested function */
  895.     DETTargetSpecification             target;                        /* The target for the request */
  896.     short                             property;                    /* The property to apply the request to */
  897.     unsigned long                     newValue;                    /*  -> New value to set property to (and set type to number) */
  898. };
  899. typedef struct DETSetPropertyNumberBlock DETSetPropertyNumberBlock;
  900.  
  901. struct DETSetPropertyRStringBlock {
  902.     DETCallBackFunctions             reqFunction;                /* Requested function */
  903.     DETTargetSpecification             target;                        /* The target for the request */
  904.     short                             property;                    /* The property to apply the request to */
  905.     RStringPtr                         newValue;                    /*  -> New value to set property to (and set type to RString) */
  906. };
  907. typedef struct DETSetPropertyRStringBlock DETSetPropertyRStringBlock;
  908.  
  909. struct DETSetPropertyBinaryBlock {
  910.     DETCallBackFunctions             reqFunction;                /* Requested function */
  911.     DETTargetSpecification             target;                        /* The target for the request */
  912.     short                             property;                    /* The property to apply the request to */
  913.     void *                            newValue;                    /*  -> New value to set property to (and set type to binary) */
  914.     long                             newValueSize;                /*  -> Size of new value */
  915. };
  916. typedef struct DETSetPropertyBinaryBlock DETSetPropertyBinaryBlock;
  917.  
  918. struct DETSetPropertyChangedBlock {
  919.     DETCallBackFunctions             reqFunction;                /* Requested function */
  920.     DETTargetSpecification             target;                        /* The target for the request */
  921.     short                             property;                    /* The property to apply the request to */
  922.     Boolean                         propertyChanged;            /*  -> Value to set changed flag on property to */
  923.     Boolean                         filler1;
  924. };
  925. typedef struct DETSetPropertyChangedBlock DETSetPropertyChangedBlock;
  926.  
  927. struct DETSetPropertyEditableBlock {
  928.     DETCallBackFunctions             reqFunction;                /* Requested function */
  929.     DETTargetSpecification             target;                        /* The target for the request */
  930.     short                             property;                    /* The property to apply the request to */
  931.     Boolean                         propertyEditable;            /*  -> Value to set editable flag on property to */
  932.     Boolean                         filler1;
  933. };
  934. typedef struct DETSetPropertyEditableBlock DETSetPropertyEditableBlock;
  935.  
  936. struct DETDirtyPropertyBlock {
  937.     DETCallBackFunctions             reqFunction;                /* Requested function */
  938.     DETTargetSpecification             target;                        /* The target for the request */
  939.     short                             property;                    /* The property to apply the request to */
  940. };
  941. typedef struct DETDirtyPropertyBlock DETDirtyPropertyBlock;
  942.  
  943. struct DETDoPropertyCommandBlock {
  944.     DETCallBackFunctions             reqFunction;                /* Requested function */
  945.     DETTargetSpecification             target;                        /* The target for the request */
  946.     short                             property;                    /* The property to apply the request to */
  947.     long                             parameter;                    /* ->  Parameter of command */
  948. };
  949. typedef struct DETDoPropertyCommandBlock DETDoPropertyCommandBlock;
  950.  
  951. struct DETSublistCountBlock {
  952.     DETCallBackFunctions             reqFunction;                /* Requested function */
  953.     DETTargetSpecification             target;                        /* The target for the request */
  954.     long                             count;                        /* <-  The number of items in the current item's sublist */
  955. };
  956. typedef struct DETSublistCountBlock DETSublistCountBlock;
  957.  
  958. struct DETSelectedSublistCountBlock {
  959.     DETCallBackFunctions             reqFunction;                /* Requested function */
  960.     DETTargetSpecification             target;                        /* The target for the request */
  961.     long                             count;                        /* <-  The number of selected items in the current item's sublist */
  962. };
  963. typedef struct DETSelectedSublistCountBlock DETSelectedSublistCountBlock;
  964.  
  965. struct DETRequestSyncBlock {
  966.     DETCallBackFunctions             reqFunction;                /* Requested function */
  967.     DETTargetSpecification             target;                        /* The target for the request */
  968. };
  969. typedef struct DETRequestSyncBlock DETRequestSyncBlock;
  970.  
  971. struct DETAddMenuBlock {
  972.     DETCallBackFunctions             reqFunction;                /* Requested function */
  973.     DETTargetSpecification             target;                        /* The target for the request */
  974.     short                             property;                    /* The property to apply the request to */
  975.     RString *                        name;                        /*  -> Name of new menu item */
  976.     long                             parameter;                    /*  -> Parameter to return when this item is selected */
  977.     long                             addAfter;                    /*  -> Parameter of entry to add after, or -1 for add at end */
  978. };
  979. typedef struct DETAddMenuBlock DETAddMenuBlock;
  980.  
  981. struct DETRemoveMenuBlock {
  982.     DETCallBackFunctions             reqFunction;                /* Requested function */
  983.     DETTargetSpecification             target;                        /* The target for the request */
  984.     short                             property;                    /* The property to apply the request to */
  985.     long                             itemToRemove;                /*  -> Parameter of menu item to remove */
  986. };
  987. typedef struct DETRemoveMenuBlock DETRemoveMenuBlock;
  988.  
  989. struct DETMenuItemRStringBlock {
  990.     DETCallBackFunctions             reqFunction;                /* Requested function */
  991.     DETTargetSpecification             target;                        /* The target for the request */
  992.     short                             property;                    /* The property to apply the request to */
  993.     long                             itemParameter;                /*  -> Parameter of menu item to return string for */
  994.     RStringHandle                     rString;                    /* <-  Handle with the RString (caller must DisposHandle() when done) */
  995. };
  996. typedef struct DETMenuItemRStringBlock DETMenuItemRStringBlock;
  997.  
  998. struct DETOpenDSSpecBlock {
  999.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1000.     PackedDSSpecPtr                 dsSpec;                        /*  -> DSSpec of object to be opened */
  1001. };
  1002. typedef struct DETOpenDSSpecBlock DETOpenDSSpecBlock;
  1003.  
  1004. struct DETAboutToTalkBlock {
  1005.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1006. };
  1007. typedef struct DETAboutToTalkBlock DETAboutToTalkBlock;
  1008.  
  1009. struct DETBreakAttributeBlock {
  1010.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1011.     DETTargetSpecification             target;                        /* The target for the request */
  1012.     AttributePtr                     breakAttribute;                /*  -> Attribute to parse */
  1013.     Boolean                         isChangeable;                /*  -> True if the value can be changed by the user */
  1014.     Boolean                         filler1;
  1015. };
  1016. typedef struct DETBreakAttributeBlock DETBreakAttributeBlock;
  1017.  
  1018. struct DETSavePropertyBlock {
  1019.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1020.     DETTargetSpecification             target;                        /* The target for the request */
  1021.     short                             property;                    /* The property to apply the request to */
  1022. };
  1023. typedef struct DETSavePropertyBlock DETSavePropertyBlock;
  1024.  
  1025. struct DETGetCustomViewUserReferenceBlock {
  1026.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1027.     DETTargetSpecification             target;                        /* The target for the request */
  1028.     short                             property;                    /* The property to apply the request to */
  1029.     short                             userReference;                /* <-  User reference value, as specified in the .r file */
  1030. };
  1031. typedef struct DETGetCustomViewUserReferenceBlock DETGetCustomViewUserReferenceBlock;
  1032.  
  1033. struct DETGetCustomViewBoundsBlock {
  1034.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1035.     DETTargetSpecification             target;                        /* The target for the request */
  1036.     short                             property;                    /* The property to apply the request to */
  1037.     Rect                             bounds;                        /* <-  Bounds of the view */
  1038. };
  1039. typedef struct DETGetCustomViewBoundsBlock DETGetCustomViewBoundsBlock;
  1040.  
  1041. struct DETGetResourceBlock {
  1042.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1043.     DETTargetSpecification             target;                        /* The target for the request */
  1044.     short                             property;                    /* The property to apply the request to */
  1045.     ResType                         resourceType;                /*  -> Resource type */
  1046.     Handle                             theResource;                /* <-  The resource handle (caller must dispose when done) */
  1047. };
  1048. typedef struct DETGetResourceBlock DETGetResourceBlock;
  1049.  
  1050. struct DETTemplateCounts {
  1051.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1052.     long                             aspectTemplateCount;        /* <-  Number of aspect templates in the system */
  1053.     long                             infoPageTemplateCount;        /* <-  Number of info-page templates in the system */
  1054. };
  1055. typedef struct DETTemplateCounts DETTemplateCounts;
  1056.  
  1057. struct DETUnloadTemplatesBlock {
  1058.     DETCallBackFunctions             reqFunction;                /* Requested function */
  1059. };
  1060. typedef struct DETUnloadTemplatesBlock DETUnloadTemplatesBlock;
  1061.  
  1062. union DETCallBackBlock {
  1063.     DETProtoCallBackBlock             protoCallBack;
  1064.     DETBeepBlock                     beep;
  1065.     DETBusyBlock                     busy;
  1066.     DETChangeCallForsBlock             changeCallFors;
  1067.     DETGetCommandSelectionCountBlock  getCommandSelectionCount;
  1068.     DETGetCommandItemNBlock         getCommandItemN;
  1069.     DETGetDSSpecBlock                 getDSSpec;
  1070.     DETGetTemplateFSSpecBlock         getTemplateFSSpec;
  1071.     DETGetOpenEditBlock             getOpenEdit;
  1072.     DETCloseEditBlock                 closeEdit;
  1073.     DETGetPropertyTypeBlock         getPropertyType;
  1074.     DETGetPropertyNumberBlock         getPropertyNumber;
  1075.     DETGetPropertyRStringBlock         getPropertyRString;
  1076.     DETGetPropertyBinarySizeBlock     getPropertyBinarySize;
  1077.     DETGetPropertyBinaryBlock         getPropertyBinary;
  1078.     DETGetPropertyChangedBlock         getPropertyChanged;
  1079.     DETGetPropertyEditableBlock     getPropertyEditable;
  1080.     DETSetPropertyTypeBlock         setPropertyType;
  1081.     DETSetPropertyNumberBlock         setPropertyNumber;
  1082.     DETSetPropertyRStringBlock         setPropertyRString;
  1083.     DETSetPropertyBinaryBlock         setPropertyBinary;
  1084.     DETSetPropertyChangedBlock         setPropertyChanged;
  1085.     DETSetPropertyEditableBlock     setPropertyEditable;
  1086.     DETDirtyPropertyBlock             dirtyProperty;
  1087.     DETDoPropertyCommandBlock         doPropertyCommand;
  1088.     DETSublistCountBlock             sublistCount;
  1089.     DETSelectedSublistCountBlock     selectedSublistCount;
  1090.     DETRequestSyncBlock             requestSync;
  1091.     DETAddMenuBlock                 addMenu;
  1092.     DETRemoveMenuBlock                 removeMenu;
  1093.     DETMenuItemRStringBlock         menuItemRString;
  1094.     DETOpenDSSpecBlock                 openDSSpec;
  1095.     DETAboutToTalkBlock             aboutToTalk;
  1096.     DETBreakAttributeBlock             breakAttribute;
  1097.     DETSavePropertyBlock             saveProperty;
  1098.     DETGetCustomViewUserReferenceBlock  getCustomViewUserReference;
  1099.     DETGetCustomViewBoundsBlock     getCustomViewBounds;
  1100.     DETGetResourceBlock             getResource;
  1101.     DETTemplateCounts                 templateCounts;
  1102.     DETUnloadTemplatesBlock         unloadTemplates;
  1103. };
  1104. typedef union DETCallBackBlock DETCallBackBlock;
  1105.  
  1106. typedef DETCallBackBlock *DETCallBackBlockPtr;
  1107. typedef union DETCallBlock DETCallBlock;
  1108. typedef DETCallBlock *DETCallBlockPtr;
  1109. typedef pascal OSErr (*DETCallBackProcPtr)(DETCallBlock *callBlockPtr, DETCallBackBlockPtr callBackBlockPtr);
  1110.  
  1111. #if GENERATINGCFM
  1112. typedef UniversalProcPtr DETCallBackUPP;
  1113. #else
  1114. typedef DETCallBackProcPtr DETCallBackUPP;
  1115. #endif
  1116. typedef DETCallBackUPP DETCallBack;
  1117. struct DETProtoCallBlock {
  1118.     DETCallFunctions                 reqFunction;                /* Requested function */
  1119.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1120.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1121.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1122.                                                                 /*    common to all invocations of code resource) */
  1123.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1124.                                                                 /*    code resource) */
  1125.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1126.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1127.     Boolean                         filler1;
  1128.     short                             property;                    /* The property number the call refers to */
  1129. };
  1130. typedef struct DETProtoCallBlock DETProtoCallBlock;
  1131.  
  1132. struct DETInitBlock {
  1133.     DETCallFunctions                 reqFunction;                /* Requested function */
  1134.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1135.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1136.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1137.     long                             newCallFors;                /* <-  New call-for mask */
  1138. };
  1139. typedef struct DETInitBlock DETInitBlock;
  1140.  
  1141. struct DETExitBlock {
  1142.     DETCallFunctions                 reqFunction;                /* Requested function */
  1143.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1144.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1145.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1146. };
  1147. typedef struct DETExitBlock DETExitBlock;
  1148.  
  1149. struct DETInstanceInitBlock {
  1150.     DETCallFunctions                 reqFunction;                /* Requested function */
  1151.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1152.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1153.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1154.                                                                 /*    common to all invocations of code resource) */
  1155.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1156.                                                                 /*    code resource) */
  1157.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1158.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1159.     Boolean                         filler1;
  1160. };
  1161. typedef struct DETInstanceInitBlock DETInstanceInitBlock;
  1162.  
  1163. struct DETInstanceExitBlock {
  1164.     DETCallFunctions                 reqFunction;                /* Requested function */
  1165.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1166.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1167.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1168.                                                                 /*    common to all invocations of code resource) */
  1169.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1170.                                                                 /*    code resource) */
  1171.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1172.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1173.     Boolean                         filler1;
  1174. };
  1175. typedef struct DETInstanceExitBlock DETInstanceExitBlock;
  1176.  
  1177. struct DETInstanceIdleBlock {
  1178.     DETCallFunctions                 reqFunction;                /* Requested function */
  1179.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1180.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1181.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1182.                                                                 /*    common to all invocations of code resource) */
  1183.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1184.                                                                 /*    code resource) */
  1185.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1186.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1187.     Boolean                         filler1;
  1188. };
  1189. typedef struct DETInstanceIdleBlock DETInstanceIdleBlock;
  1190.  
  1191. struct DETPropertyCommandBlock {
  1192.     DETCallFunctions                 reqFunction;                /* Requested function */
  1193.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1194.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1195.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1196.                                                                 /*    common to all invocations of code resource) */
  1197.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1198.                                                                 /*    code resource) */
  1199.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1200.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1201.     Boolean                         filler1;
  1202.     short                             property;                    /* The property number the call refers to */
  1203.     long                             parameter;                    /*  -> Parameter of command */
  1204. };
  1205. typedef struct DETPropertyCommandBlock DETPropertyCommandBlock;
  1206.  
  1207. struct DETMaximumTextLengthBlock {
  1208.     DETCallFunctions                 reqFunction;                /* Requested function */
  1209.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1210.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1211.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1212.                                                                 /*    common to all invocations of code resource) */
  1213.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1214.                                                                 /*    code resource) */
  1215.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1216.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1217.     Boolean                         filler1;
  1218.     short                             property;                    /* The property number the call refers to */
  1219.     long                             maxSize;                    /* <-  Return the maximum number of characters the user can entry when property is edited in an EditText */
  1220. };
  1221. typedef struct DETMaximumTextLengthBlock DETMaximumTextLengthBlock;
  1222.  
  1223. struct DETViewListChangedBlock {
  1224.     DETCallFunctions                 reqFunction;                /* Requested function */
  1225.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1226.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1227.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1228.                                                                 /*    common to all invocations of code resource) */
  1229.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1230.                                                                 /*    code resource) */
  1231.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1232.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1233.     Boolean                         filler1;
  1234. };
  1235. typedef struct DETViewListChangedBlock DETViewListChangedBlock;
  1236.  
  1237. struct DETPropertyDirtiedBlock {
  1238.     DETCallFunctions                 reqFunction;                /* Requested function */
  1239.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1240.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1241.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1242.                                                                 /*    common to all invocations of code resource) */
  1243.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1244.                                                                 /*    code resource) */
  1245.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1246.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1247.     Boolean                         filler1;
  1248.     short                             property;                    /* The property number the call refers to */
  1249. };
  1250. typedef struct DETPropertyDirtiedBlock DETPropertyDirtiedBlock;
  1251.  
  1252. struct DETValidateSaveBlock {
  1253.     DETCallFunctions                 reqFunction;                /* Requested function */
  1254.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1255.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1256.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1257.                                                                 /*    common to all invocations of code resource) */
  1258.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1259.                                                                 /*    code resource) */
  1260.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1261.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1262.     Boolean                         filler1;
  1263.     RStringHandle                     errorString;                /* <-  Handle with error string if validation fails (callee must allocate handle, DE will DisposHandle() it) */
  1264. };
  1265. typedef struct DETValidateSaveBlock DETValidateSaveBlock;
  1266.  
  1267. struct DETDropQueryBlock {
  1268.     DETCallFunctions                 reqFunction;                /* Requested function */
  1269.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1270.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1271.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1272.                                                                 /*    common to all invocations of code resource) */
  1273.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1274.                                                                 /*    code resource) */
  1275.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1276.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1277.     Boolean                         filler1;
  1278.     short                             modifiers;                    /*  -> Modifiers at drop time (option/control/command/shift keys) */
  1279.     long                             commandID;                    /* <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) */
  1280.     AttributeType                     destinationType;            /* <-> Type to convert attribute to */
  1281.     Boolean                         copyToHFS;                    /* <-  If true, object should be copied to HFS before being operated on, and deleted after */
  1282.     Boolean                         filler2;
  1283. };
  1284. typedef struct DETDropQueryBlock DETDropQueryBlock;
  1285.  
  1286. struct DETDropMeQueryBlock {
  1287.     DETCallFunctions                 reqFunction;                /* Requested function */
  1288.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1289.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1290.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1291.                                                                 /*    common to all invocations of code resource) */
  1292.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1293.                                                                 /*    code resource) */
  1294.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1295.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1296.     Boolean                         filler1;
  1297.     short                             modifiers;                    /*  -> Modifiers at drop time (option/control/command/shift keys) */
  1298.     long                             commandID;                    /* <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) */
  1299.     AttributeType                     destinationType;            /* <-> Type to convert attribute to */
  1300.     Boolean                         copyToHFS;                    /* <-  If true, object should be copied to HFS before being operated on, and deleted after */
  1301.     Boolean                         filler2;
  1302. };
  1303. typedef struct DETDropMeQueryBlock DETDropMeQueryBlock;
  1304.  
  1305. struct DETAttributeCreationBlock {
  1306.     DETCallFunctions                 reqFunction;                /* Requested function */
  1307.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1308.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1309.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1310.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1311.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1312.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1313.     AttributeType                     attrType;                    /* <-> The type of the attribute being created */
  1314.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being created */
  1315.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1316. };
  1317. typedef struct DETAttributeCreationBlock DETAttributeCreationBlock;
  1318.  
  1319. struct DETAttributeNewBlock {
  1320.     DETCallFunctions                 reqFunction;                /* Requested function */
  1321.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1322.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1323.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1324.                                                                 /*    common to all invocations of code resource) */
  1325.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1326.                                                                 /*    code resource) */
  1327.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1328.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1329.     Boolean                         filler1;
  1330.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1331.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1332.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1333.     AttributeType                     attrType;                    /* <-> The type of the attribute being created */
  1334.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being created */
  1335.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1336. };
  1337. typedef struct DETAttributeNewBlock DETAttributeNewBlock;
  1338.  
  1339. struct DETAttributeChangeBlock {
  1340.     DETCallFunctions                 reqFunction;                /* Requested function */
  1341.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1342.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1343.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1344.                                                                 /*    common to all invocations of code resource) */
  1345.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1346.                                                                 /*    code resource) */
  1347.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1348.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1349.     Boolean                         filler1;
  1350.     PackedDSSpecPtr                 parent;                        /*  -> The object within which the creation will occur */
  1351.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1352.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as in the parent object */
  1353.     AttributeType                     attrType;                    /* <-> The type of the attribute being changed */
  1354.     AttributeTag                     attrTag;                    /* <-> The tag of the attribute being changed */
  1355.     AttributeCreationID             attrCID;                    /* <-> The CID of the attribute being changed */
  1356.     Handle                             value;                        /* <-> The value to write (pre-allocated, resize as needed) */
  1357. };
  1358. typedef struct DETAttributeChangeBlock DETAttributeChangeBlock;
  1359.  
  1360. struct DETAttributeDeleteBlock {
  1361.     DETCallFunctions                 reqFunction;                /* Requested function */
  1362.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1363.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1364.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1365.                                                                 /*    common to all invocations of code resource) */
  1366.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1367.                                                                 /*    code resource) */
  1368.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1369.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1370.     Boolean                         filler1;
  1371.     PackedDSSpecPtr                 dsSpec;                        /*  -> The object which will be deleted */
  1372.     short                             refNum;                        /*  -> Refnum for returned address (DSSpecs in PDs only) */
  1373.     AuthIdentity                     identity;                    /*  -> The identity we're browsing as */
  1374. };
  1375. typedef struct DETAttributeDeleteBlock DETAttributeDeleteBlock;
  1376.  
  1377. struct DETItemNewBlock {
  1378.     DETCallFunctions                 reqFunction;                /* Requested function */
  1379.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1380.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1381.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1382.                                                                 /*    common to all invocations of code resource) */
  1383.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1384.                                                                 /*    code resource) */
  1385.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1386.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1387.     Boolean                         filler1;
  1388. };
  1389. typedef struct DETItemNewBlock DETItemNewBlock;
  1390.  
  1391. struct DETShouldSyncBlock {
  1392.     DETCallFunctions                 reqFunction;                /* Requested function */
  1393.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1394.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1395.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1396.                                                                 /*    common to all invocations of code resource) */
  1397.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1398.                                                                 /*    code resource) */
  1399.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1400.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1401.     Boolean                         filler1;
  1402.     Boolean                         shouldSync;                    /* <-  True if we should now sync with catalog */
  1403.     Boolean                         filler2;
  1404. };
  1405. typedef struct DETShouldSyncBlock DETShouldSyncBlock;
  1406.  
  1407. struct DETDoSyncBlock {
  1408.     DETCallFunctions                 reqFunction;                /* Requested function */
  1409.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1410.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1411.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1412.                                                                 /*    common to all invocations of code resource) */
  1413.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1414.                                                                 /*    code resource) */
  1415.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1416.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1417.     Boolean                         filler1;
  1418. };
  1419. typedef struct DETDoSyncBlock DETDoSyncBlock;
  1420.  
  1421. struct DETPatternInBlock {
  1422.     DETCallFunctions                 reqFunction;                /* Requested function */
  1423.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1424.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1425.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1426.                                                                 /*    common to all invocations of code resource) */
  1427.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1428.                                                                 /*    code resource) */
  1429.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1430.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1431.     Boolean                         filler1;
  1432.     short                             property;                    /* The property number the call refers to */
  1433.     long                             elementType;                /*  -> Element type from pattern */
  1434.     long                             extra;                        /*  -> Extra field from pattern */
  1435.     AttributePtr                     attribute;                    /*  -> The complete attribute */
  1436.     long                             dataOffset;                    /* <-> Offset to current (next) byte */
  1437.     short                             bitOffset;                    /* <-> Bit offset (next bit is *fData >> fBitOffset++) */
  1438. };
  1439. typedef struct DETPatternInBlock DETPatternInBlock;
  1440.  
  1441. struct DETPatternOutBlock {
  1442.     DETCallFunctions                 reqFunction;                /* Requested function */
  1443.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1444.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1445.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1446.                                                                 /*    common to all invocations of code resource) */
  1447.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1448.                                                                 /*    code resource) */
  1449.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1450.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1451.     Boolean                         filler1;
  1452.     short                             property;                    /* The property number the call refers to */
  1453.     long                             elementType;                /*  -> Element type from pattern */
  1454.     long                             extra;                        /*  -> Extra field from pattern */
  1455.     AttributePtr                     attribute;                    /*  -> The attribute (minus the data portion) */
  1456.     Handle                             data;                        /*  -> Data to be written (pre-allocated, resize and add at end) */
  1457.     long                             dataOffset;                    /* <-> Offset to next byte to write */
  1458.     short                             bitOffset;                    /* <-> Bit offset (if zero, handle will need to be resized to one more byte before write) */
  1459. };
  1460. typedef struct DETPatternOutBlock DETPatternOutBlock;
  1461.  
  1462. struct DETOpenSelfBlock {
  1463.     DETCallFunctions                 reqFunction;                /* Requested function */
  1464.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1465.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1466.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1467.                                                                 /*    common to all invocations of code resource) */
  1468.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1469.                                                                 /*    code resource) */
  1470.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1471.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1472.     Boolean                         filler1;
  1473.     short                             modifiers;                    /*  -> Modifiers at open time (option/control/command/shift keys) */
  1474. };
  1475. typedef struct DETOpenSelfBlock DETOpenSelfBlock;
  1476.  
  1477. struct DETConvertToNumberBlock {
  1478.     DETCallFunctions                 reqFunction;                /* Requested function */
  1479.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1480.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1481.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1482.                                                                 /*    common to all invocations of code resource) */
  1483.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1484.                                                                 /*    code resource) */
  1485.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1486.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1487.     Boolean                         filler1;
  1488.     short                             property;                    /* The property number the call refers to */
  1489.     long                             theValue;                    /* <-  The converted value to return */
  1490. };
  1491. typedef struct DETConvertToNumberBlock DETConvertToNumberBlock;
  1492.  
  1493. struct DETConvertToRStringBlock {
  1494.     DETCallFunctions                 reqFunction;                /* Requested function */
  1495.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1496.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1497.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1498.                                                                 /*    common to all invocations of code resource) */
  1499.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1500.                                                                 /*    code resource) */
  1501.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1502.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1503.     Boolean                         filler1;
  1504.     short                             property;                    /* The property number the call refers to */
  1505.     RStringHandle                     theValue;                    /* <-  A handle with the converted value (callee must allocate handle, DE will DisposHandle() it) */
  1506. };
  1507. typedef struct DETConvertToRStringBlock DETConvertToRStringBlock;
  1508.  
  1509. struct DETConvertFromNumberBlock {
  1510.     DETCallFunctions                 reqFunction;                /* Requested function */
  1511.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1512.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1513.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1514.                                                                 /*    common to all invocations of code resource) */
  1515.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1516.                                                                 /*    code resource) */
  1517.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1518.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1519.     Boolean                         filler1;
  1520.     short                             property;                    /* The property number the call refers to */
  1521.     long                             theValue;                    /*  -> The value to convert (result should be written direct to the property) */
  1522. };
  1523. typedef struct DETConvertFromNumberBlock DETConvertFromNumberBlock;
  1524.  
  1525. struct DETConvertFromRStringBlock {
  1526.     DETCallFunctions                 reqFunction;                /* Requested function */
  1527.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1528.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1529.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1530.                                                                 /*    common to all invocations of code resource) */
  1531.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1532.                                                                 /*    code resource) */
  1533.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1534.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1535.     Boolean                         filler1;
  1536.     short                             property;                    /* The property number the call refers to */
  1537.     RStringPtr                         theValue;                    /*  -> The value to convert (result should be written direct to the property) */
  1538. };
  1539. typedef struct DETConvertFromRStringBlock DETConvertFromRStringBlock;
  1540.  
  1541. struct DETCustomViewDrawBlock {
  1542.     DETCallFunctions                 reqFunction;                /* Requested function */
  1543.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1544.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1545.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1546.                                                                 /*    common to all invocations of code resource) */
  1547.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1548.                                                                 /*    code resource) */
  1549.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1550.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1551.     Boolean                         filler1;
  1552.     short                             property;                    /* The property number the call refers to */
  1553. };
  1554. typedef struct DETCustomViewDrawBlock DETCustomViewDrawBlock;
  1555.  
  1556. struct DETCustomViewMouseDownBlock {
  1557.     DETCallFunctions                 reqFunction;                /* Requested function */
  1558.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1559.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1560.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1561.                                                                 /*    common to all invocations of code resource) */
  1562.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1563.                                                                 /*    code resource) */
  1564.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1565.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1566.     Boolean                         filler1;
  1567.     short                             property;                    /* The property number the call refers to */
  1568.     EventRecord *                    theEvent;                    /*  -> The original event record of the mouse-down */
  1569. };
  1570. typedef struct DETCustomViewMouseDownBlock DETCustomViewMouseDownBlock;
  1571.  
  1572. struct DETKeyPressBlock {
  1573.     DETCallFunctions                 reqFunction;                /* Requested function */
  1574.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1575.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1576.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1577.                                                                 /*    common to all invocations of code resource) */
  1578.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1579.                                                                 /*    code resource) */
  1580.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1581.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1582.     Boolean                         filler1;
  1583.     short                             property;                    /* The property number the call refers to */
  1584.     EventRecord *                    theEvent;                    /*  -> The original event record of the key-press */
  1585. };
  1586. typedef struct DETKeyPressBlock DETKeyPressBlock;
  1587.  
  1588. struct DETPasteBlock {
  1589.     DETCallFunctions                 reqFunction;                /* Requested function */
  1590.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1591.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1592.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1593.                                                                 /*    common to all invocations of code resource) */
  1594.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1595.                                                                 /*    code resource) */
  1596.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1597.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1598.     Boolean                         filler1;
  1599.     short                             property;                    /* The property number the call refers to */
  1600.     short                             modifiers;                    /*  -> Modifiers at paste time (option/control/command/shift keys) */
  1601. };
  1602. typedef struct DETPasteBlock DETPasteBlock;
  1603.  
  1604. struct DETCustomMenuSelectedBlock {
  1605.     DETCallFunctions                 reqFunction;                /* Requested function */
  1606.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1607.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1608.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1609.                                                                 /*    common to all invocations of code resource) */
  1610.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1611.                                                                 /*    code resource) */
  1612.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1613.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1614.     Boolean                         filler1;
  1615.     short                             menuTableParameter;            /*  -> The "property" field from the custom menu table */
  1616. };
  1617. typedef struct DETCustomMenuSelectedBlock DETCustomMenuSelectedBlock;
  1618.  
  1619. struct DETCustomMenuEnabledBlock {
  1620.     DETCallFunctions                 reqFunction;                /* Requested function */
  1621.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1622.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1623.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1624.                                                                 /*    common to all invocations of code resource) */
  1625.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1626.                                                                 /*    code resource) */
  1627.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1628.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1629.     Boolean                         filler1;
  1630.     short                             menuTableParameter;            /*  -> The "property" field from the custom menu table */
  1631.     Boolean                         enable;                        /* <-  Whether to enable the menu item */
  1632.     Boolean                         filler2;
  1633. };
  1634. typedef struct DETCustomMenuEnabledBlock DETCustomMenuEnabledBlock;
  1635.  
  1636. struct DETForwarderListItem {
  1637.     struct DETForwarderListItem **    next;                        /* Pointer to next item, or nil */
  1638.     AttributeTag                     attributeValueTag;            /* Tag of new templates (0 for none) */
  1639.     PackedPathName                     rstrs;                        /* Record type (empty if none), attrbute type (empty if none),list of template names to forward to */
  1640. };
  1641. typedef struct DETForwarderListItem DETForwarderListItem;
  1642.  
  1643. typedef DETForwarderListItem *DETForwarderListPtr;
  1644. typedef DETForwarderListPtr *DETForwarderListHandle;
  1645. struct DETDynamicForwardersBlock {
  1646.     DETCallFunctions                 reqFunction;                /* Requested function */
  1647.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1648.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1649.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, common to all invocations of code resource) */
  1650.     DETForwarderListHandle             forwarders;                    /* <-  List of forwaders */
  1651. };
  1652. typedef struct DETDynamicForwardersBlock DETDynamicForwardersBlock;
  1653.  
  1654. struct DETDynamicResourceBlock {
  1655.     DETCallFunctions                 reqFunction;                /* Requested function */
  1656.     DETCallBack                     callBack;                    /* Pointer to call-back routine */
  1657.     long                             callBackPrivate;            /* Private data for the call-back routine */
  1658.     long                             templatePrivate;            /* Private storage for use by code resource (stays for life of code resource, */
  1659.                                                                 /*    common to all invocations of code resource) */
  1660.     long                             instancePrivate;            /* Private storage for use by code resource (separate for each item using the */
  1661.                                                                 /*    code resource) */
  1662.     DETTargetSpecification             target;                        /* The target (originator) of the call, for targeted and property calls */
  1663.     Boolean                         targetIsMainAspect;            /* True if the target is the main aspect (even though it has a non-nil name) */
  1664.     Boolean                         filler1;
  1665.     ResType                         resourceType;                /*  -> The resource type being requested */
  1666.     short                             propertyNumber;                /*  -> The property number of the resource being requested */
  1667.     short                             resourceID;                    /*  -> The resource ID (base ID + property number) of the resource */
  1668.     Handle                             theResource;                /* <-  The requested resource */
  1669. };
  1670. typedef struct DETDynamicResourceBlock DETDynamicResourceBlock;
  1671.  
  1672. union DETCallBlock {
  1673.     DETProtoCallBlock                 protoCall;
  1674.     DETInitBlock                     init;
  1675.     DETExitBlock                     exit;
  1676.     DETInstanceInitBlock             instanceInit;
  1677.     DETInstanceExitBlock             instanceExit;
  1678.     DETInstanceIdleBlock             instanceIdle;
  1679.     DETPropertyCommandBlock         propertyCommand;
  1680.     DETMaximumTextLengthBlock         maximumTextLength;
  1681.     DETViewListChangedBlock         viewListChanged;
  1682.     DETPropertyDirtiedBlock         propertyDirtied;
  1683.     DETValidateSaveBlock             validateSave;
  1684.     DETDropQueryBlock                 dropQuery;
  1685.     DETDropMeQueryBlock             dropMeQuery;
  1686.     DETAttributeCreationBlock         attributeCreationBlock;
  1687.     DETAttributeNewBlock             attributeNew;
  1688.     DETAttributeChangeBlock         attributeChange;
  1689.     DETAttributeDeleteBlock         attributeDelete;
  1690.     DETItemNewBlock                 itemNew;
  1691.     DETPatternInBlock                 patternIn;
  1692.     DETPatternOutBlock                 patternOut;
  1693.     DETShouldSyncBlock                 shouldSync;
  1694.     DETDoSyncBlock                     doSync;
  1695.     DETOpenSelfBlock                 openSelf;
  1696.     DETConvertToNumberBlock         convertToNumber;
  1697.     DETConvertToRStringBlock         convertToRString;
  1698.     DETConvertFromNumberBlock         convertFromNumber;
  1699.     DETConvertFromRStringBlock         convertFromRString;
  1700.     DETCustomViewDrawBlock             customViewDraw;
  1701.     DETCustomViewMouseDownBlock     customViewMouseDown;
  1702.     DETKeyPressBlock                 keyPress;
  1703.     DETPasteBlock                     paste;
  1704.     DETCustomMenuSelectedBlock         customMenuSelected;
  1705.     DETCustomMenuEnabledBlock         customMenuEnabled;
  1706.     DETDynamicForwardersBlock         dynamicForwarders;
  1707.     DETDynamicResourceBlock         dynamicResource;
  1708. };
  1709.  
  1710.  
  1711. enum {
  1712.     uppDETCallBackProcInfo = kPascalStackBased
  1713.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  1714.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DETCallBlock *)))
  1715.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DETCallBackBlockPtr)))
  1716. };
  1717.  
  1718. #if GENERATINGCFM
  1719. #define CallDETCallBackProc(userRoutine, callBlockPtr, callBackBlockPtr)        \
  1720.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDETCallBackProcInfo, (callBlockPtr), (callBackBlockPtr))
  1721. #else
  1722. #define CallDETCallBackProc(userRoutine, callBlockPtr, callBackBlockPtr)        \
  1723.         (*(userRoutine))((callBlockPtr), (callBackBlockPtr))
  1724. #endif
  1725.  
  1726. #if GENERATINGCFM
  1727. #define NewDETCallBackProc(userRoutine)        \
  1728.         (DETCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDETCallBackProcInfo, GetCurrentArchitecture())
  1729. #else
  1730. #define NewDETCallBackProc(userRoutine)        \
  1731.         ((DETCallBackUPP) (userRoutine))
  1732. #endif
  1733. /* Call-for list: */
  1734.  
  1735. enum {
  1736.     kDETCallForOther            = 1,                            /* Call for things not listed below (also auto-enabled by DE if any of the below are enabled) */
  1737.     kDETCallForIdle                = 2,                            /* kDETcmdIdle */
  1738.     kDETCallForCommands            = 4,                            /* kDETcmdPropertyCommand, kDETcmdSelfOpen */
  1739.     kDETCallForViewChanges        = 8,                            /* kDETcmdViewListChanged, kDETcmdPropertyDirtied, kDETcmdMaximumTextLength */
  1740.     kDETCallForDrops            = 0x10,                            /* kDETcmdDropQuery, kDETcmdDropMeQuery */
  1741.     kDETCallForAttributes        = 0x20,                            /* kDETcmdAttributeCreation, kDETcmdAttributeNew, kDETcmdAttributeChange, kDETcmdAttributeDelete */
  1742.     kDETCallForValidation        = 0x40,                            /* kDETcmdValidateSave */
  1743.     kDETCallForKeyPresses        = 0x80,                            /* kDETcmdKeyPress and kDETcmdPaste */
  1744.     kDETCallForResources        = 0x0100,                        /* kDETcmdDynamicResource */
  1745.     kDETCallForSyncing            = 0x0200,                        /* kDETcmdShouldSync, kDETcmdDoSync */
  1746.     kDETCallForEscalation        = 0x8000,                        /* All calls escalated from the next lower level */
  1747.     kDETCallForNothing            = 0,                            /* None of the above */
  1748.     kDETCallForEverything        = 0xFFFFFFFF                    /* All of the above */
  1749. };
  1750.  
  1751. typedef pascal OSErr (*DETCallProcPtr)(DETCallBlockPtr callBlockPtr);
  1752.  
  1753. #if GENERATINGCFM
  1754. typedef UniversalProcPtr DETCallUPP;
  1755. #else
  1756. typedef DETCallProcPtr DETCallUPP;
  1757. #endif
  1758.  
  1759. enum {
  1760.     uppDETCallProcInfo = kPascalStackBased
  1761.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  1762.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DETCallBlockPtr)))
  1763. };
  1764.  
  1765. #if GENERATINGCFM
  1766. #define NewDETCallProc(userRoutine)        \
  1767.         (DETCallUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDETCallProcInfo, GetCurrentArchitecture())
  1768. #else
  1769. #define NewDETCallProc(userRoutine)        \
  1770.         ((DETCallUPP) (userRoutine))
  1771. #endif
  1772.  
  1773. #if GENERATINGCFM
  1774. #define CallDETCallProc(userRoutine, callBlockPtr)        \
  1775.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDETCallProcInfo, (callBlockPtr))
  1776. #else
  1777. #define CallDETCallProc(userRoutine, callBlockPtr)        \
  1778.         (*(userRoutine))((callBlockPtr))
  1779. #endif
  1780. typedef DETCallUPP DETCall;
  1781. /* This following macro saves you from having to dig out the call-back pointer from the call block: */
  1782. #define CallBackDET(callBlockPtr, callBackBlockPtr) CallDETCallBackProc(callBlockPtr->protoCall.callBack,callBlockPtr,callBackBlockPtr)
  1783. #endif /* REZ */
  1784.  
  1785. /************************************************************************************/
  1786. /********************************* SAM Definitions: *********************************/
  1787. /************************************************************************************/
  1788.  
  1789. /* SAM Developers should use property numbers starting at this point: */
  1790. #define kSAMFirstDevProperty                kDETFirstDevProperty + 10
  1791.  
  1792.  
  1793. /*
  1794.     SAM templates have additional resources/properties that are required
  1795.     for interaction with the AOCE Key Chain.
  1796.     
  1797.      Type    Offset                        Description
  1798.      ----    ------                        -----------
  1799.     'rstr'    kSAMAspectUserName            The user name
  1800.     'rstr'    kSAMAspectKind                The kind of SAM
  1801.     'detn'    kSAMAspectCannotDelete        If 0, then the slot cannot be deleted
  1802.     'sami'    kSAMAspectSlotCreationInfo    The info required to create a slot record
  1803. */
  1804.  
  1805. #define kSAMAspectUserName                        kDETFirstDevProperty + 1
  1806. #define kSAMAspectKind                            kDETFirstDevProperty + 2
  1807. #define kSAMAspectCannotDelete                    kDETFirstDevProperty + 3
  1808. #define kSAMAspectSlotCreationInfo                kDETFirstDevProperty + 4
  1809.  
  1810. /**************************************************************************************
  1811.  ********************************* Admin Definitions: *********************************
  1812.  **************************************************************************************/
  1813.  
  1814. #define kDETAdminVersion         -978
  1815.  
  1816.  
  1817. #endif
  1818. #ifndef REZ
  1819. #endif /* REZ */
  1820.  
  1821. #if PRAGMA_ALIGN_SUPPORTED
  1822. #pragma options align=reset
  1823. #endif
  1824.  
  1825. #if PRAGMA_IMPORT_SUPPORTED
  1826. #pragma import off
  1827. #endif
  1828.  
  1829. #ifdef __cplusplus
  1830. }
  1831. #endif
  1832.  
  1833. #endif /* __OCETEMPLATES__ */
  1834.  
  1835.